package cn.iocoder.yudao.module.policy.controller.admin;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.policy.entity.BannerDO;
import cn.iocoder.yudao.module.policy.service.BannerService;
import cn.iocoder.yudao.module.policy.vo.banner.BannerPageReqVO;
import cn.iocoder.yudao.module.policy.vo.banner.BannerRespVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.annotation.security.PermitAll;
import javax.validation.Valid;
import java.util.List;


@Tag(name = "APP - 轮播图")
@RestController
@RequestMapping("/app/banner")
@Validated
public class APPBannerController {

    @Resource
    private BannerService bannerService;


    @GetMapping("/list")
    @Operation(summary = "获得轮播图数据")
    @PermitAll
    public CommonResult<List<BannerDO>> getBannerList(@Valid BannerRespVO pageReqVO) {
        List<BannerDO> bannerList = bannerService.getBannerList(pageReqVO);
        return CommonResult.success(bannerList);
    }


}